README For:
    Ganapati, Sharat and McKibbin, Rebecca., (2021) "Markups and Fixed Costs in Generic and Off-Patent Pharmaceutical Markets" Review of Economics and Statistics: Forthcoming.

Instructions:
	Download the following files:
		RESTAT-ReplicationPackage.tar.gz.partaa
		RESTAT-ReplicationPackage.tar.gz.partab
		RESTAT-ReplicationPackage.tar.gz.partac

	Combine the files using 
	    cat RESTAT-ReplicationPackage.tar.gz.parta * > ReplicationPackage.tar.gz

	Unzip and untar using you chosen utility file
		
	Change the $PATH Directory in Programs/ 00_Master_restat.do
	
	Run the program Programs/ 00_Master_restat.do

    Tested using Stata 16.1/MP on macOS 11.5.1 Big Sur with 64 GB memory and 100 GB of hard drive space.

    Currently you need to install the following packages in STATA 16.1
        ssc install coefplot
        ssc install blindschemes
        ssc install estout
        ssc install ftools
        ssc install gtools
        ssc install coefplot
        ssc install reghdfe
        ssc install texsave

Raw Data Files:

    ATCDDD_Data/*
        European Commission Public Health, “All centralized human medicinal product by ATC code”, Downloaded May 2018

    Australia/ASM_Data/*
        Australian Drug Utilisation Sub-Committee (DUSC) of the Pharmaceutical Benefits Advisory, “Australian Statistics on Medicines (ASM)”, Accessed April 2018

    Australia/Schedule/*
        Australian Department of Health, “Pharmaceutical Benefits Scheme Schedule”, Accessed September 2017

    Australia/Section85/*
        Australian Department of Health, “PBS and RPBS Section 85 Date of Processing and Date of Supply Data”, Accessed April 2019

    Canada/Mfg/*
        Health Canada, “Drug Product Database (DPD)” Accessed 2018-07-03

    Canada/Mfg/CA_xwalk_mfg.xlsx
        Author Created Data Crosswalk

    Canada/Ontario/*
        Ontario Ministry of Health and Long-Term Care, “Ontario Drug Benefit (ODB) Program Edition 42”, December 2017

    Canada/BC/*
        B.C. Ministry of Health, Pharmaceutical Services Division, “PharmaCare Downloadable Data File”, Accessed May 2018.

    Drugsatfda/*
        U.S. Food and Drug Administration, “Drugs@FDA: FDA-Approved Drugs Database”, Accessed April 2019

    ExchangeRates/FRED/*
        Federal Reserve Bank of St. Louis, “Foreign Exchange Rates” Accessed June 2018.

    MedicarePartD/*
        U.S. Centers for Medicare & Medicaid Services, “Medicare Provider Utilization and Payment Data: Part D Prescriber PUF” Accessed June 2018, Updated December 2019

    MEPS/*
        U.S. Agency for Healthcare Research and Quality, “The Medical Expenditure Panel Survey (MEPS)” Accessed March 2018

    NationalDrugCode/NBER/*
        U.S. Food and Drug Administration, “NDC Data -- National Drug Code Data” Accessed via NBER.org in July 2017

    NationalDrugCode/Crosswalk/*
        U.S. Food and Drug Administration, “NDC to Labeler Code Product Code Crosswalk” Accessed via NBER.org in May 2018

    NationalDrugCode/Product.txt
        U.S. Food and Drug Administration, “National Drug Code Directory”, Accessed July 2017

    NHS_emits/*
        UK National Health Service, Department of Health and Social Care “Drugs and pharmaceutical electronic market information tool (eMIT)”, Accessed June 2018

    NZ/*
        New Zealand Medicines and Medical Device Safety Authority (MEDSAFE). “Product/Application Search”, Accessed July, 2018
        New Zealand Pharmaceutical Management Agency. “Online Pharmaceutical Schedule”, Accessed June, 2020

    NZ/NZ_xwalk.xlsx
        Author Created Data Crosswalk

    OrangeBook/*
        U.S. Food and Drug Administration, “Orange Book: Approved Drug Products with Therapeutic Equivalence Evaluations” Accessed December 2016 and updated April 2018.

    State Drug Utilization Data/*
        U.S. Centers for Medicare & Medicaid Services, “Medicare State Drug Utilization Data”, Accessed June 2017, updated June 2018

    UK_Data/*
        Centre for Evidence-Based Medicine, Nuffield Department of Primary Care Health Sciences, University of Oxford, “Drug Tariff viewer”, Accessed May 2018

    UK_Doses/*
        U.K. National Health Service, Business Services Authority, “Prescription Cost Analysis (PCA) data”, Accessed August 2018

    UK_Mfg_Data/*
        UK Medicines and Healthcare Products Regulatory Agency (MHRA) and the European Medicines Agency (EMA). “The electronic Medicines Compendium (eMC)”, Accessed July 2018

    UK_Mfg_Data/xwalk_UK_mfg.xlsx
        Author Created Data Crosswalk

    US_FUL/*
        U.S. Centers for Medicare & Medicaid Services, “Affordable Care Act Federal upper limit (FUL) data”, Accessed June 2018

    US_NADAC/*
        U.S. Centers for Medicare & Medicaid Services, “National Average Drug Acquisition Cost (NADAC) for Medicaid Covered Outpatient Drugs”, Accessed July 2018

    Data Cleaning and Analysis Programs:

    Programs/ 00_Master_restat.do
        Master Replication File
        To run, set the global variable $PATH to the root directory
        Tested using Stata 16.1/MP on macOS 11.5.1 Big Sur with 64 GB memory and 100 GB of hard drive space.
        Log file of published version in Log/

        Read-in programs for various data sources:
            01_Readin_Drug_Codes_v2.do	: Read in US Drug Codes
            01_Readin_NADAC.do		    : Read in US NADAC Data
            01_Readin_US_Generics_v2.do	: Read data to filter US Generics
            01_Readin_FUL_v2.do		    : Read in US FUL Data
            01_Readin_AU_v6.do			: Read in AU Data
            01_Readin_NZ_v2.do			: Read in NZ Data
            01_Readin_CA_v2.do			: Read in CA Data for British Columbia and Ontario
            01_Readin_UK_v3.do			: Read in UK/England Data
            01_Readin_Medicaid_v6.do    : Read in US Medicaid Data
            01_Readin_Medicare_v2.do	: Read in US Medicare Data
            01_Readin_MEPS_v2.do		: Read in US MEPS Data

        Analysis Programs
            02_Analysis_v16_shortRR.do
            03_Analysis_fixed_bounding_v3.do

    Output Files:
        Main Text Outputs:
            TABLE1A_summary_medicaid_amp.csv
            TABLE1A_summary_medicaid_amp.tex
            TABLE1B_Data_Description_2017.csv
            TABLE2A_Margins_medicaid_dose_Y.tex
            TABLE2A_Margins_medicaid_dose_Y_f.tex
            TABLE2B_Margins_medicaid_dose_both_Y.tex
            TABLE2B_Margins_medicaid_dose_both_Y_f.tex
            FIG1_2017_medicaid_amp.pdf
            FIG2_markup_breakdown.eps
            FIG3_AU_fixed_diff_drug.pdf
            MEPS_data.csv

        Appendix Output Files:
            APX_Fig_ATC3.pdf
            APX_Fig_ATC3formulations.pdf
            APX_Fig_ATC3patents.pdf
            APX_Fig_Age.pdf
            APX_Fig_Fixed_rmfg.pdf
            APX_Fig_Lag.pdf
            APX_Fig_M_EMPIRIC_medicaid.pdf
            APX_Fig_MarketSize_qty.pdf
            APX_Fig_Mfg_AU_US_Q.pdf
            APX_Fig_Mfg_UK_US_Q.pdf
            APX_Fig_NADAC.pdf
            APX_Fig_P_diff_AU.pdf
            APX_Fig_P_diff_AUq.pdf
            APX_Fig_P_diff_US.pdf
            APX_Fig_P_diff_USq.pdf
            APX_Fig_Pooled_medicaid_amp.pdf
            APX_Fig_Pooled_medicaid_un.pdf
            APX_Fig_genericonly.pdf
            APX_Fig_markup_dispensing_breakdown.eps
            APX_Fig_partD.pdf
            APX_Tab_Margins_medicaid_dose_YD.tex
            APX_Tab_Margins_medicaid_dose_YD_f.tex
            APX_Tab_supply.tex

